﻿using Coldairarrow.Entity.Base;
using Coldairarrow.Entity.Base_Manage;
using Coldairarrow.Entity.DTO;
using Coldairarrow.Util;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Coldairarrow.Business.Base
{
    public partial interface IBase_DeviceBusiness
    {
        Task<PageResult<Base_DeviceDTO>> GetDataListAsync(PageInput<DeviceConditionDTO> input);
        Task<Base_Device> GetTheDataAsync(string id);
        Task AddDataAsync(Base_Device data);
        Task UpdateDataAsync(Base_Device data);
        Task DeleteDataAsync(List<string> ids);
        Task AddUserExlAsync(List<Base_Device> list);
        Task<List<Base_DeviceDTO>> Selectid(string id);
        IQueryable<T> GetQueryable<T>() where T : class, new();
        /// <summary>
        /// 获取操作者法人下的所有部门
        /// </summary>
        /// <returns></returns>
        Task<List<Base_Department>> GetDetpListAsync();
        /// <summary>
        /// 获取当前操作者操作人工厂下下的所有车间
        /// </summary>
        /// <returns></returns>
        Task<List<Base_Department>> GetDetpListAsyncWorkShop();
        /// <summary>
        /// 获取当前操作者操作人部门下下的所有车间
        /// </summary>
        /// <returns></returns>
        Task<List<Base_Department>> GetDetpListAsyncBumen();
        /// <summary>
        /// 获取当前操作者操作人的工厂
        /// </summary>
        /// <returns></returns>
        Task<List<Base_Department>> GetDetpListAsyncFatoc7();
        Task<List<Base_Department>> GetDetpListAsyncFatoc();

        /// <summary>
        /// 获取当前部门下所有车间
        /// </summary>
        /// <returns></returns>
        Task<List<Base_Department>> GetDetpListAsyncBumenis();
    }

    public class DeviceConditionDTO
    {
        public string Condition { get; set; }
        public string Keyword { get; set; }

        /// <summary>
        /// 工序Id
        /// </summary>
        public string SubId { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public string DeviceType { get; set; }

        /// <summary>
        /// 设备规格
        /// </summary>
        public string DeviceSpec { get; set; }

    }
}